package photogcalc;

import photogcalc.common.Constants;
import photogcalc.util.Settings;

/**
 *
 * @author aokkonen
 */
public class MainModel extends BaseModel {

    public MainModel() {
        readSettings();
    }

    public void readSettings() {
        // Read settings
        Settings settings = new Settings("CameraCalculator");
        settings.open();
        settings.readRecords();

        if (settings.get("textfielddefault") == null) {
            settings.put("textfielddefault", new Integer(Constants.ANY).toString());
        }

        setSettings(settings);
    }

    public void writeSettings() {
        getSettings().saveRecords();
        getSettings().close();
    }
}
